<script src='http://protozoa.googlecode.com/svn/trunk/js/all.js'></script>
<script src='../diff.js'></script>

<table style='width:100%;height:100%'>
<tr>
<td>
	<p>
		Compare files <a href='a.txt'>a.txt</a> (~115k) and <a href='b.txt'>b.txt</a> (~129k).
	</p>
	<button onclick='test_show_diff()'>Show diff</button>
	&nbsp;&nbsp;
	<button onclick='test_run_benchmark()'>Run benchmark</button>
	<hr>
<tr>
<td>
	<div id='status'>&nbsp;</div>
<tr>
<td style='height:100%'>
	<textarea id='out' style='width:100%;height:100%'></textarea>
</table>



<script>

var test_show_diff = function() {
	var oStatus = document.getElementById('status');
	oStatus.innerHTML = 'Loading files...';
	var a = load_file('a.txt');
	var b = load_file('b.txt');
	oStatus.innerHTML = 'Processing...';	
	var start = +new Date;
	var result = diff(a, b);
	var time = (+new Date - start) / 1000;
	document.getElementById('out').value = result;
	oStatus.innerHTML = 'Time: ' + time + ' seconds';
};

var test_run_benchmark = function() {
	var a = load_file('a.txt');
	var b = load_file('b.txt');
	run_time_test(function(){ return diff(a, b) });
};

</script>